How to Add SearchUnit to SharePoint

This example shows the simplest steps required to add SearchUnit to your SharePoint site using Visual Studio 2010.

Currently there is a known issue with the design time support when creating a Visual Web Part project for SharePoint however working with the ASPX directly, as explained below, is very straightforward.

1. Create a SharePoint Visual Web Part project.
  1. From Visual Studio select New Project > SharePoint > Visual Web Part project, enter the project name and click OK. Select the instance of SharePoint to use for debugging and click Finish.

  2. Open your project's .ascx page designer and drag the SearchResult control to the page.

    (If the SearchUnit controls are not in the ToolBox already, they can be added by manually navigating to the product DLL and dragging 'Keyoti2.SearchEngine.Web.dll' to the toolbox).

  3. Create a folder to store the Index Directory files. This folder will need to be accessible to all SharePoint users that have access to the page containing the search control. e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\7803\IndexDirectory


  4. Set the IndexDirectory property of the SearchResult control, to the path of the IndexDirectory created above. This will need to be set in code;

2. Creating your Index
  1. Navigate to your 'SearchUnit' installation folder

    (Typically under C:\Program Files (x86)\Keyoti Inc\SearchUnit)

    Open the folder containing the DLL's for your .Net Framework version and open 'Keyoti Search Index Manager Tool Launcher'.

  2. Enter the path to your Index Directory folder and click Open.

    e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\7803\IndexDirectory

    The Configuration file for your Index Directory will need to be changed to allow the crawler to access a SharePoint site using IIS authentication. Click the Configuration tab and find the 'WebsiteCredentials' section.

    Enter the path to your SharePoint site followed by the username and password for a user that has access to the parts of the site you want to be searchable (Administrator for example).

  3. To begin importing your SharePoint site select the Indexed Sources tab and click 'Import New Source'. Set the Start URL to the path of your SharePoint site e.g. http://win-bqdrfp492op:7803/int/default.aspx

    Under 'More Options' you can specify path matches that should be ignored during the import (admin only sections for example) and/or set only those path matches to be included in the import. E.g. "/_" was ignored so all paths containing "/_" will not be indexed.

    Once you have the desired settings close the form and click 'Import' to begin indexing your SharePoint site.

3. Deploying your Visual Web Part project.
  1. In your Visual Web Part project select 'Build' and 'Deploy Solution'.

  2. Navigate to your SharePoint site and select 'Edit Page' then 'Add a Web Part'. Under Categories select your project and click 'Add'.

Try a test search. Should you have any trouble please email support at keyoti.com

AJAX Features (AutoComplete & ResultPreviewer)

When enabling the Auto Complete or Result Previewer features you will need to add a httphandler in IIS;

  1. Open IIS 7 and select the SharePoint site
  2. Open Handler mappings
  3. Click Add Managed Handler
  4. For 'Request Path' enter; Keyoti.SearchEngine.Web.CallBackHandler.ashx
  5. For 'Type' enter; Keyoti.SearchEngine.Web.CallBackHandler, Keyoti2.SearchEngine.Web, Version=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e
    (where 2012.?.?.? should be replaced with the version number of the Keyotix.SearchEngine.Web DLL)
  6. For 'Name' enter; Keyoti AJAX
  7. Restart IIS